<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta charset="UTF-8">
	<title>添加新闻信息</title>
	<meta name="renderer" content="webkit">	
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">	
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">	
	<meta name="apple-mobile-web-app-status-bar-style" content="black">	
	<meta name="apple-mobile-web-app-capable" content="yes">	
	<meta name="format-detection" content="telephone=no">	
	<link rel="stylesheet" type="text/css" href="common/layui/css/layui.css" media="all">
	<link rel="stylesheet" type="text/css" href="common/bootstrap/css/bootstrap.css" media="all">
	<link rel="stylesheet" type="text/css" href="common/global.css" media="all">
	<link rel="stylesheet" type="text/css" href="css/personal.css" media="all">
	<script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
</head>
<body class="childrenBody">
		<div class="layui-form-item">
			<label class="layui-form-label">添加类型</label>
			<div class="layui-input-block">
				<input name="certerType" class="layui-input newsName" lay-verify="required" placeholder="请输入新闻类型" type="text">
			</div>
		</div>
			<div class="layui-form-item">
			<div class="layui-input-block">
				<button class="layui-btn" name="addType"  lay-filter="addNews">立即添加</button>
				<button type="reset" class="layui-btn layui-btn-primary">重置</button>
		    </div>
	</div>
	
	<script type="text/javascript" src="common/layui/layui.js"></script>
<!-- 添加类型 -->
<script type="text/javascript">
layui.use(['form','element','jquery','layer','laydate'], function(){
	var $=layui.jquery,form=layui.form,laydate = layui.laydate;
	$(function(){
		$("button[name='addType']").bind('click',function(){
			var certerType=$("input[name='certerType']").val();
			if(certerType!=""&&certerType!=null){
				$.ajax({
					type:"POST",
					dataType:"json",
					url:"../informationAction!addType",
					data:{"certerType":certerType},
					success:function(mag){
						layer.alert('添加类型成功!', {icon: 1});
					}
				})
			}else{
				layer.msg('添加类型失败类型不能为空！', {icon: 5});
			}
			
		});
	});
});
</script>
	
</body>
</html>